home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6514 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: news.PBI.net!usenet
  2. From: mich@pbinet.com
  3. Newsgroups: comp.lang.c
  4. Subject: Re: GNU C & pow(x,y)
  5. Date: 25 Feb 1996 16:11:49 GMT
  6. Organization: Pacific Bell Internet Services
  7. Message-ID: <4gq1o5$386@SNFC21_SRVR_WWW.PBI.net>
  8. References: <9602162139036@br-ranch.org>
  9. Reply-To: mich@pbinet.com
  10. NNTP-Posting-Host: ppp-5-8.rdcy01.pbinet.com
  11. X-Newsreader: IBM NewsReader/2 v1.03
  12.  
  13. In <9602162139036@br-ranch.org>, robert.threet@br-ranch.org (Robert Threet) writes:
  14. >I've tried using 1/x instead of the negative exponent, but I don't 
  15. >think that's my problem.  Here's the line:
  16.  
  17. >  paymnt = pow((amt * mo_rate)/(1-(1 + mo_rate)), (-mo_rate));
  18.  
  19. >All variables are defined as floating point.  I've included
  20. >"math.h" and I use this to compile:
  21.  
  22. >  gcc -o mort mort.c -lm
  23.  
  24. >Despite this I keep getting the error: "undefined ref. to pow".
  25.  
  26. >Can someone...
  27.  
  28. >A) Tell me what I'm doing wrong...  or
  29. >B) Give me a better formula for calculating a mortgage payment?
  30.  
  31. I don't think your formula is the problem. Don't you need to explicately name the
  32. object file on the command line for GCC? Also, you might make sure you're using
  33. function prototypes.
  34.  
  35.